%ion-modal-view#quan-page
  %ion-header-bar.bar-furion(align-title="center")
    %button.back-button(ng-click="closeQuanselect()")
    %h1.title 选择优惠券
    %button.cancel-button(ng-click="cancelQuanselect()")

  %ion-content
    .padding-10.small(ng-if="0 < quans.length")
      您本次可用优惠券共
      %span.red {{quans.length}}
      张
    .list.padding-lr-10.no-margin-bottom
      .item.top-space-tiny(ng-repeat="quan in quans" ng-click="toggleQuan(quan)")
        %div(ng-if="quan.m_type == 'd'")
          .quan-red
          .row.row-quan
            .col.col-33.flex-center
              .value
                .unit ¥
                %span {{quan.value}}
            .col
              %p.title {{quan.vname}}
              %pre.desc
                %div(ng-if="quan.minium_amount_required")
                  本金高于{{quan.minium_amount_required}}可以使用
                %div(ng-if="quan.minium_days_required > 0")
                  期限大于{{quan.minium_days_required}}天可以使用
                %div(ng-if="quan.maxmium_days_required")
                  期限小于{{quan.maxmium_days_required}}天可以使用
              %p.timelimit 有效期至: {{quan.expire_at | DateTimeToSecondsQuan}}
        %div(ng-if="quan.m_type == 'jiaxi'")
          .quan-yellow
          .row.row-quan
            .col.col-33.flex-center
              .text-center
                .value
                  .unit +
                  %span {{quan.add_rate}}
                  .unit %
            .col
              %p.title {{quan.vname}}
              %pre.desc
                %div(ng-if="quan.minium_amount_required")
                  本金高于{{quan.minium_amount_required}}可以使用
                %div(ng-if="quan.minium_days_required > 0")
                  期限大于{{quan.minium_days_required}}天可以使用
                %div(ng-if="quan.maxmium_days_required")
                  期限小于{{quan.maxmium_days_required}}天可以使用
              %p.timelimit 有效期至: {{quan.expire_at | DateTimeToSecondsQuan}}


    .padding-10.small(ng-if="0 == quans.length")
      您本次无可用优惠券

    .list.padding-lr-10(ng-if="unavailable_quans.length > 0")
      .item.top-space-tiny(ng-repeat="q in unavailable_quans")
        .quan-grey
        .row.row-quan(ng-if="q.m_type == 'd'")
          .col.col-33.flex-center
            .value.light-grey
              .unit ¥
              %span {{q.value}}
          .col
            %p.title.light-grey {{q.vname}}
            %pre.desc {{q.reason}}
            %p.timelimit 有效期至: {{q.expire_at | DateTimeToSecondsQuan}}
        .row.row-quan(ng-if="q.m_type == 'jiaxi' || q.m_type == 'j' ")
          .col.col-33.flex-center
            .value.light-grey
              .unit +
              %span {{q.add_rate}}
              .unit %
          .col
            %p.title.light-grey {{q.vname}}
            %pre.desc {{q.reason}}
            %p.timelimit 有效期至: {{q.expire_at | DateTimeToSecondsQuan}}
